package cn.com.connext.scrm.domain.master;

import com.connext.common.domain.UUIDDomain;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.cloud.cloudfoundry.com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.Valid;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.Objects;

/**
 * Created by YANG205 on 2018/6/27.
 */
@Entity
@Table(name = "support_third_interface")   // 定义数据库表名
@Data
public class SupportThirdInterface implements UUIDDomain{
    private static final long serialVersionUID = 1L;

    @Id
    private String id;
    //skuId
    @Column(name = "sku_id", nullable = false)
    private String skuId;
    //uniqueCode唯一码
    @Column(name = "unique_code", nullable = false)
    private String uniqueCode;

    @Column(name = "create_time", nullable = false)
    @JsonFormat(pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @Column(name = "brand", nullable = false)
    private String brand;

    @Column(name = "owner_id", nullable = false)
    private String ownerId;
    @Column(name = "owner_name", nullable = false)
    private String ownerName;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSkuId() {
        return skuId;
    }

    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    public String getUniqueCode() {
        return uniqueCode;
    }

    public void setUniqueCode(String uniqueCode) {
        this.uniqueCode = uniqueCode;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(String ownerId) {
        this.ownerId = ownerId;
    }

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SupportThirdInterface that = (SupportThirdInterface) o;
        return Objects.equals(uniqueCode, that.uniqueCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uniqueCode);
    }
}
